home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 501-525 / disk_519 / avlsort / isatty.c < prev    next >
C/C++ Source or Header  |  1992-05-06  |  1KB  |  34 lines

  1. /*==========================================================================
  2.  * ISATTY.C, by Robert L. Pyron
  3.  *
  4.  * Naive implementation of isatty() for Amiga using Lattice C 5.05.
  5.  * See the following message excerpt (from BIX) about why this
  6.  * approach may not be such a good idea...
  7.  *
  8.  *--------------------------------------------------------------------------
  9.  * sas.c/old.amiga.c #4245, from jtoebes, Fri Dec 8 09:42:11 1989
  10.  *--------------------------------------------------------------------------
  11.  * As for isatty(), IsInteractive may not be the best choice for what you
  12.  * want.  It returns True for prt:.  You may wish to consider sending a
  13.  * ACTION_INFO packet or an ACTION_RAWMODE packet to the handler and see
  14.  * if it returns ACTION_NOT_KNOWN or not.  Whawes can verify the best choice
  15.  * of packets to use for the test.
  16.  *
  17.  *==========================================================================
  18.  */
  19.  
  20. #include <stdio.h>
  21. #include <ios1.h>
  22. #include <proto/dos.h>
  23.  
  24. int __regargs isatty( int fd )
  25. {
  26.     struct    UFB    *ufb;
  27.  
  28.     if ( (ufb = chkufb(fd)) == NULL )
  29.         return( 0 );
  30.     else
  31.         return (int) IsInteractive( ufb->ufbfh );
  32. }
  33.  
  34.